//
//  CommonPickerModel.swift
//  EyeVisionForDoctors
//
//  Created by PMC on 2020/3/2.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import HandyJSON

struct CommonPickerModel: HandyJSON {
    var code: String = ""
    var name: String = ""
    var icdId: String = ""
    var helpCode: String = ""
    var patientId: String = ""
    var id: String = ""
//    static func getPickerListData(category: String, success: @escaping (_ models: [CommonPickerModel]) -> Void, failure: @escaping (_ errorMsg: String?) -> Void) {
//        let paras = ["category": category]
//        HttpTool.shared.request(target: ApiManager.getPickerListData(paras: paras), success: { (json, code) in
//            switch code {
//            case .failure:
//                failure(json["message"].description)
//            case .success:
//                if let models = JSONDeserializer<CommonPickerModel>.deserializeModelArrayFrom(json: json["data"].description) as? [CommonPickerModel] {
//                    success(models)
//                } else {
//                    failure("请求数据发生错误，稍后重试")
//                }
//            }
//        }) { errorMsg in
//            failure(errorMsg)
//        }
//    }
//    
//    /// 获取疾病列表
//    static func getDiseaseList(name: String = "", firstLetter: String = "", code: String = "", success: @escaping (_ models: [CommonPickerModel]) -> Void, failure: @escaping (_ errorMsg: String?) -> Void) {
//        let paras = ["name": name, "helpCode": firstLetter, "code": code]
//        HttpTool.shared.request(target: ApiManager.getDiseaseList(paras: paras), success: { (json, code) in
//            switch code {
//            case .failure:
//                failure(json["message"].description)
//            case .success:
//                if let models = JSONDeserializer<CommonPickerModel>.deserializeModelArrayFrom(json: json["data"].description) as? [CommonPickerModel] {
//                    success(models)
//                } else {
//                    failure("请求数据发生错误，稍后重试")
//                }
//            }
//        }) { errorMsg in
//            failure(errorMsg)
//        }
//    }
}
